﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using umbraco.cms.businesslogic.datatype;
using umbraco.interfaces;


namespace Umb.SimpleWebsite.Shared.DataTypes.SingleItemPicker
{
    /// <summary>
    /// Needs to Extend Existing functionality with extra things:
    /// 1. Content picker, Media picker: will show not only item title, but also item path
    /// 2. Mode detailed information about chosen dataitem
    /// 3. Tree picker needs to start from [xpath query] node
    /// 3. More Better graphical design
    /// </summary>
    public class PropertyDataType : AbstractDataEditor
    {
        public override Guid Id
        {
            get
            {
                return new Guid("5CFCB479-3A2F-4592-BB6C-3FF899B0FEDC");
            }
        }

        public override string DataTypeName
        {
            get
            {
                return "ISM_ Single Item Picker";
            }
        }

        private PropertyPreValues prevalueEditor;
        public override IDataPrevalue PrevalueEditor
        {
            get
            {
                if (prevalueEditor==null) prevalueEditor=new PropertyPreValues(this,DataTypeName.Replace(" ",""));
                return prevalueEditor;
            }
        }

        private IDataEditor dataEditor;
        public override umbraco.interfaces.IDataEditor DataEditor
        {
            get
            {
                if (dataEditor == null) dataEditor = new PropertyDataEditor(this.Data, this);
                return dataEditor;
            }
        }
    }
}
